package com.gzy.xuexiziliao.controller.Ai;

import com.gzy.xuexiziliao.common.result.Result;
import com.gzy.xuexiziliao.utils.AIUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;

@RequiredArgsConstructor
@RestController
@Slf4j
public class Test {

    private  final AIUtil aiUtil ;
    @GetMapping("/test")
    public Result<String> getByName(String msg,String model) throws IOException {

        String ans = aiUtil.aiTalk(msg, model);
        log.info("测试接口{}", ans);
        return Result.success(ans);
    }
}
